package com.sawyer.dao;

import com.sawyer.entity.Emp;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface EmpDAO {
    @Select("select  id,name,salary,age,bir from t_emp")
    List<Emp> findAll();
    @Insert("insert into t_emp values (#{id},#{name},#{salary},#{age},#{bir})")
    void save(Emp emp);
    @Delete("delete from t_emp where id=#{id}")
    void delete(String id);
    @Select("select id,name,salary,age,bir from t_emp where id =#{id}")
    Emp find(String id);
    @Update("update t_emp set name=#{name},salary=#{salary},age=#{age},bir=#{bir}\n" +
            "Ewhere id=#{id}")
    void update(Emp emp);
}
